<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.css" rel="stylesheet" />
		<style>
			body{
				background: #FFFFFF;
			}
			.mui-bar{
				height:172.5px;
				background:linear-gradient(180deg,rgba(252,126,119,1) 0%,rgba(254,96,93,1) 100%);
			}
			a , .mui-title{
				color:rgba(255,255,255,1);
			}
			.container_dep{
				width:100%;
				position: relative;
				float: left;
				margin-top: 34.5px;
			}
			.dep_one{
				width:33%;
				position: relative;
				float: left;
				text-align: center;
			}
			.dep_one>img{
				width: 27px;
				height: 27px;
			}
			.dep_one>p{
				font-size:15px;
				font-family:PingFang-SC-Medium;
				font-weight:500;
				color:rgba(255,255,255,1);
			}
			.dep_two{
				width:33%;
				position: relative;
				float: left;
				text-align: center;
			}
			.dep_two>img{
				width: 103.5px;
				height: 8.5px;
				position: relative;
				float: left;
				margin-top: -15px;
			}
			.dep_two>p{
				font-size:13px;
				font-family:PingFang-SC-Medium;
				font-weight:500;
				color:rgba(255,255,255,0.7);
			}
			.dep_three{
				width: 33%;
				position: relative;
				float: left;
				text-align: center;
			}
			.dep_three>img{
				width: 27.5px;
				height: 27.5px;
				}
			.dep_three>p{
				font-size:15px;
				font-family:PingFang-SC-Medium;
				font-weight:500;
				color:rgba(255,255,255,1);
			}
			.mui-content{
				width: 100%;
				position: relative;
				float: left;
				margin-top: 160px;
				background: #FFFFFF;
			}
			.content_one{
				width: 100%;
				position: relative;
				float: left;
				padding-left: 15px;
				box-sizing: border-box;
			}
			.content_one>span:nth-child(1){
				font-size:15px;
				font-family:PingFang-SC-Medium;
				font-weight:500;
				color:rgba(51,51,51,1);
			}
			.content_one>span:nth-child(2){
				font-size:15px;
				font-family:PingFang-SC-Bold;
				font-weight:bold;
				color:rgba(254,102,98,1);
			}
			.content_two{
				width: 100%;
				position: relative;
				float: left;
				padding-left: 15px;
				box-sizing: border-box;
			}
			.content_two>span{
				font-size:13px;
				font-family:PingFang-SC-Medium;
				font-weight:500;
				color:rgba(153,153,153,1);
			}
			.content_three{
				width: calc(96% - 15px);
				position: relative;
				float: left;
				margin-left: 15px;
				border-bottom: 1px solid #d4d4d4;
				margin-top: 38.5px;
			}
			.content_three>img{
				width: 18px;
				height: 18px;
				position: relative;
				float: left;
				margin-top: 10px;
			}
			.content_three>input{
				width: 72%;
				border: none;
				margin-bottom: 0px;
				padding: 9px 6px;
			}
			::-webkit-input-placeholder{
				font-size:15px;
				font-family:PingFang-SC-Medium;
				font-weight:500;
				color:rgba(188,188,188,1);
			}
			.content_btn{
				width: 100%;
				position: relative;
				float: left;
				text-align: center;
				margin-top: 98.5px;
			}
			.content_btn>button{
				width:90%;
				height:43px;
				background:linear-gradient(180deg,rgba(252,126,119,1) 0%,rgba(254,96,93,1) 100%);
				box-shadow:0px 2.5px 4px 0px rgba(254, 95, 99, 0.35);
				border-radius:21.5px;
				font-size:16px;
				font-family:PingFang-SC-Bold;
				font-weight:bold;
				color:rgba(255,255,255,1);
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">提现</h1>
			<div class="container_dep">
				<div class="dep_one">
					<img src="../image/jinbi.png" alt="">
					<p>金币</p>
				</div>
				<div class="dep_two">
					<p>金额</p>
					<img src="../image/xian.png" alt="">
				</div>
				<div class="dep_three">
					<img src="../image/zhifubao.png" alt="">
					<p>支付宝</p>
				</div>
			</div>
		</header>
		<div class="mui-content">
			<div class="content_one">
				<span>可提现金币:</span>
				<span id='myicons'>8</span>
			</div>
			<div class="content_two">
				<span id='duihuan'>1金币=10元人民币</span>
			</div>
			<div class="content_three">
				<img src="../image/jinbia.png" alt="">
				<input type="text" name="" id="icons" value="" placeholder="输入提现金币数量"/>
			</div>
			<div class="content_three">
             <input type="text" name="" id="zhifu_name" value="" placeholder="支付宝姓名"/>
			</div>
			<div class="content_three">
                 <input type="text" name="" id="alipay" value="" placeholder="支付宝账号"/>
			</div>
			<div class="content_btn">
				<button>立即提现</button>
			</div>
		</div>
		<script src="../js/mui.js"></script>
		<script src="../js/jquery-3.1.1.min.js"></script>
		<script type="text/javascript">
			mui.plusReady(function(){
				var url = plus.storage.getItem('url');
				var user = plus.storage.getItem('user');
				user = JSON.parse(user);
				var min = 0;
				mui.post(url+'/juyou/congzhi/gettixian',{token:user.token},function(res){
					if(res.code==200){
						$("#myicons").text(res.data.my);
						var str = res.data.jinbi+'金币='+res.data.rmb+'元人民币';
						$("#duihuan").text(str);
						min = parseFloat(res.data.min);
						// mui.alert(min);
					}else{
						mui.toast(res.msg);
					}
				})
				mui.init({
					beforeback: function() {　　　　
					var list = plus.webview.currentWebview().opener();　　　　
						  //refresh是A页面自定义事件
					mui.fire(list, 'refresh');
						 //返回true,继续页面关闭逻辑
					return true;
					},
				});
				mui(document).on('tap','.content_btn',function(){
					document.activeElement.blur();
					var icons = $("#icons").val();
					var zhifu_name = $("#zhifu_name").val();
					var alipay = $("#alipay").val();
					if(parseFloat(icons)<min){
						mui.toast('提现最小数量'+min);
						return
					}
					if(!zhifu_name){
						mui.toast('请填写支付宝姓名');
						return
					}
					if(!alipay){
						mui.toast('请填写支付宝账号');
						return
					}
					mui.post(url+'/juyou/congzhi/mytixian',{token:user.token,icons:icons,zhifu_name:zhifu_name,alipay:alipay},function(res){
						if(res.code==200){
							mui.toast('提现成功，等待平台给你打款');
							setTimeout(function(){
								location.reload();
							},1500)
						
						}else{
							mui.toast(res.msg);
						}
					})
					
				})
			})
			
		</script>
	</body>

</html>
